#!/usr/bin/python
# --coding:utf-8--

from bs4 import BeautifulSoup

html = """
<html><head><title>这是个测试主题</title></head>
<body><div>
    <ul>
         <li class="item-0"><a href="https://www.dushu.com/lianzai/1115_1.html">这是第1个链接</a></li>
         <li class="item-1"><a href="https://www.dushu.com/lianzai/1115_2.html">这是第2个链接</a></li>
         <li class="item-inactive"><a href="https://www.dushu.com/lianzai/1115_3.html">
             <span class="bold">这是第3个链接</span></a>
         </li>
         <li class="item-2"><a href="https://www.dushu.com/lianzai/1115_4.html">这是第4个链接</a></li>
         <li class="item-3"><a href="https://www.dushu.com/lianzai/1115_5.html">
             <span class="link-1">这是第3个链接</span></a>
     </li></ul>
 </div>
<p class="内容">...</p>
<p class="主题" name="theme"><b>主题信息</b></p>
<p class="详情">内容详情
"""


# 创建 Beautiful Soup 对象
# 使用lxml来进行解析
soup = BeautifulSoup(html, "lxml")

print(soup.prettify())
